import axios from 'axios'
const request = axios.create({
  baseURL: '/api',
  timeout: 5000,
  timeoutErrorMessage: '请求超时'
})

// 拦截请求
request.interceptors.request.use(
  config => { return config },
  err => { console.log(err) }
)

// 拦截响应
request.interceptors.response.use(
  res => { return res.data },
  err => { console.log(err) }
)

export default request
